﻿Imports extremo

Public Class NuevosProveedores
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click

        Try
            Dim negocio = New ProveedorNegocio
            negocio.insertar(Me.txtNombre.Text, Me.txtRuc.Text, Me.txtDireccion.Text, Me.txtTelefono.Text)

            Me.txtNombre.Text = ""
            Me.txtRuc.Text = ""
            Me.txtDireccion.Text = ""
            Me.txtTelefono.Text = ""
           
            Response.Write("Se insertó correctamente")

        Catch ex As Exception
            Response.Write("Problemas al insertar")
        End Try

    End Sub


    Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Response.Redirect("Proveedores.aspx", True)
    End Sub
End Class